package com.ilink.teacherservice.service;

import com.baomidou.mybatisplus.extension.service.IService;

import com.ilink.ilinkapi.dto.teacher.CrudCourseRequest;
import com.ilink.ilinkcommon.domain.PO.trainingCamp.TrainingCamp;
import com.ilink.teacherservice.entity.DTO.CourseResponse;
import com.ilink.teacherservice.entity.DTO.StudyCourseFileResponse;
import com.ilink.teacherservice.entity.DTO.StudyResourceDto;
import com.ilink.teacherservice.entity.DTO.StudySourceFileResponse;
import com.ilink.ilinkcommon.domain.PO.studyservice.StudyTeacherCourse;
import com.ilink.teacherservice.entity.VO.CourserReviewResponse;
import com.ilink.teacherservice.entity.VO.TrainingCampListResponse;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

public interface StudyaboutTeacherService extends IService<StudyTeacherCourse> {


    @Transactional
    boolean createCourseWithFolder(String userid, CrudCourseRequest newTeacherCourse, List<MultipartFile> files) throws Exception;

//    boolean deleteCoursefile(Long courseFileId,Long courseId) throws Exception;
    boolean updateCourseById(String userId, Long courseId, CrudCourseRequest updatedTeacherCourse,
                         List<MultipartFile> files);
    boolean deleteCourse(Long course_id);

    boolean createChapter(String fileName, Long courseId) throws Exception;
    boolean newcreateChapter(String fileName, Long courseFileId, Integer sortOrder) throws Exception;

    List<StudyCourseFileResponse> getUserCourseResourceTree(String userId);
    StudyCourseFileResponse getCourseTree(String userId, Long courseId);

    List<StudyCourseFileResponse> getCourseFiles(Long courseFileId,String sentence);

    List<StudySourceFileResponse> getSourseFiles(Long courseFileId,String sentence);

    //递归删除文件夹下对应的所有子文件夹和资源
    @Transactional
    boolean deleteCoursefileBycourseFile(Long courseFileId,Long courseId) throws Exception;

    boolean deleteSourcesfile(Long sourceId, String type) throws Exception;

    List<String> getCommonTags();

    List<StudyCourseFileResponse> getUserCourseByuserId(String userId,String sentence);


    List<StudySourceFileResponse> getSourseFilesALL(String userId,String sentence);

    List<StudyResourceDto> getSortedResources(Long courseFileId, String sentence);


    //记录更新用于对于某课程的学习情况
    int updateUserCourseStudyRecord(Long courseId, String userId, Integer time,
        boolean isStudyStart);

    CourserReviewResponse getCourseReview(String coursesTag, String userId);

    List<TrainingCampListResponse> getTrainingCampList(String sentence);

    boolean createTrainingCamp(TrainingCamp trainingCamp, MultipartFile trainingCampImage);

    List<TrainingCampListResponse> getTrainingCampListBytag(String coursesTag);

    int hasKnowledgeSpace();

    String getKnowledgeSpaceId();

    String getRootFolderId(String courseId);
}
